{"ast":null,"code":"import { useObserver } from \"./useObserver\";\nfunction ObserverComponent(_a) {\n  var children = _a.children,\n    render = _a.render;\n  var component = children || render;\n  if (typeof component !== \"function\") {\n    return null;\n  }\n  return useObserver(component);\n}\nif (\"production\" !== process.env.NODE_ENV) {\n  ObserverComponent.propTypes = {\n    children: ObserverPropsCheck,\n    render: ObserverPropsCheck\n  };\n}\nObserverComponent.displayName = \"Observer\";\nexport { ObserverComponent as Observer };\nfunction ObserverPropsCheck(props, key, componentName, location, propFullName) {\n  var extraKey = key === \"children\" ? \"render\" : \"children\";\n  var hasProp = typeof props[key] === \"function\";\n  var hasExtraProp = typeof props[extraKey] === \"function\";\n  if (hasProp && hasExtraProp) {\n    return new Error(\"MobX Observer: Do not use children and render in the same time in`\" + componentName);\n  }\n  if (hasProp || hasExtraProp) {\n    return null;\n  }\n  return new Error(\"Invalid prop `\" + propFullName + \"` of type `\" + typeof props[key] + \"` supplied to\" + \" `\" + componentName + \"`, expected `function`.\");\n}","map":{"version":3,"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAO3C,SAASC,iBAAiB,CAACC,EAAoC;MAAlCC,QAAQ;IAAEC,MAAM;EACzC,IAAMC,SAAS,GAAGF,QAAQ,IAAIC,MAAM;EACpC,IAAI,OAAOC,SAAS,KAAK,UAAU,EAAE;IACjC,OAAO,IAAI;;EAEf,OAAOL,WAAW,CAACK,SAAS,CAAC;AACjC;AACA,IAAI,YAAY,KAAKC,OAAO,CAACC,GAAG,CAACC,QAAQ,EAAE;EACvCP,iBAAiB,CAACQ,SAAS,GAAG;IAC1BN,QAAQ,EAAEO,kBAAkB;IAC5BN,MAAM,EAAEM;GACX;;AAELT,iBAAiB,CAACU,WAAW,GAAG,UAAU;AAE1C,SAASV,iBAAiB,IAAIW,QAAQ;AAEtC,SAASF,kBAAkB,CACvBG,KAA2B,EAC3BC,GAAW,EACXC,aAAqB,EACrBC,QAAa,EACbC,YAAoB;EAEpB,IAAMC,QAAQ,GAAGJ,GAAG,KAAK,UAAU,GAAG,QAAQ,GAAG,UAAU;EAC3D,IAAMK,OAAO,GAAG,OAAON,KAAK,CAACC,GAAG,CAAC,KAAK,UAAU;EAChD,IAAMM,YAAY,GAAG,OAAOP,KAAK,CAACK,QAAQ,CAAC,KAAK,UAAU;EAC1D,IAAIC,OAAO,IAAIC,YAAY,EAAE;IACzB,OAAO,IAAIC,KAAK,CACZ,oEAAoE,GAAGN,aAAa,CACvF;;EAGL,IAAII,OAAO,IAAIC,YAAY,EAAE;IACzB,OAAO,IAAI;;EAEf,OAAO,IAAIC,KAAK,CACZ,gBAAgB,GACZJ,YAAY,GACZ,aAAa,GACb,OAAOJ,KAAK,CAACC,GAAG,CAAC,GACjB,eAAe,GACf,IAAI,GACJC,aAAa,GACb,yBAAyB,CAChC;AACL","names":["useObserver","ObserverComponent","_a","children","render","component","process","env","NODE_ENV","propTypes","ObserverPropsCheck","displayName","Observer","props","key","componentName","location","propFullName","extraKey","hasProp","hasExtraProp","Error"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/mobx-react-lite/src/ObserverComponent.ts"],"sourcesContent":["import { useObserver } from \"./useObserver\"\n\ninterface IObserverProps {\n    children?(): React.ReactElement | null\n    render?(): React.ReactElement | null\n}\n\nfunction ObserverComponent({ children, render }: IObserverProps) {\n    const component = children || render\n    if (typeof component !== \"function\") {\n        return null\n    }\n    return useObserver(component)\n}\nif (\"production\" !== process.env.NODE_ENV) {\n    ObserverComponent.propTypes = {\n        children: ObserverPropsCheck,\n        render: ObserverPropsCheck\n    }\n}\nObserverComponent.displayName = \"Observer\"\n\nexport { ObserverComponent as Observer }\n\nfunction ObserverPropsCheck(\n    props: { [k: string]: any },\n    key: string,\n    componentName: string,\n    location: any,\n    propFullName: string\n) {\n    const extraKey = key === \"children\" ? \"render\" : \"children\"\n    const hasProp = typeof props[key] === \"function\"\n    const hasExtraProp = typeof props[extraKey] === \"function\"\n    if (hasProp && hasExtraProp) {\n        return new Error(\n            \"MobX Observer: Do not use children and render in the same time in`\" + componentName\n        )\n    }\n\n    if (hasProp || hasExtraProp) {\n        return null\n    }\n    return new Error(\n        \"Invalid prop `\" +\n            propFullName +\n            \"` of type `\" +\n            typeof props[key] +\n            \"` supplied to\" +\n            \" `\" +\n            componentName +\n            \"`, expected `function`.\"\n    )\n}\n"]},"metadata":{},"sourceType":"module"}